﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GmailMetroNotifier.Client.Common
{
    /// <summary>
    /// Helper class to assist with collections
    /// </summary>
    public static class CollectionHelper
    {
        /// <summary>
        /// Gets whether the collection is null or empty.
        /// </summary>
        /// <typeparam name="T">The type of objects in the collection.</typeparam>
        /// <param name="collection">The collection to check.</param>
        /// <returns>True if the collection is not null and not empty, false otherwise.</returns>
        public static bool IsNullOrEmpty<T>(IEnumerable<T> collection)
        {
            return (collection == null || collection.Count() == 0);
        }
    }
}
